using Zhaoxi.Zhihu.Core.QuestionAggregate.Entites;
using Zhaoxi.Zhihu.SharedKerel.Specification;

namespace Zhaoxi.Zhihu.Core.QuestionAggregate.Specifications;

public class AnswerByIdWithLikeByUserIdSpec: Specification<Answer>
{
    public AnswerByIdWithLikeByUserIdSpec(int answerId,int userId)
    {
        FilterCondition = answer=> answer.Id == answerId;
        AddInclude(answer=> answer.AnswerLikes.Where(al => al.UserId == userId));
    }
}